<template>
  <view class="cms-box">
    <template v-for="(item, index) in list" :key="item.id">
      <Banner v-if="item.type === 'banner'" :item="item" :index="index" />
      <ImageList
        v-else-if="item.type === 'imageList'"
        :item="item"
        :index="index"
      />
      <view v-else>-</view>
    </template>
  </view>
</template>

<script setup lang="ts">
import cosProps from '../cms'

import Banner from '@/components/cms/Banner/index.vue'
import ImageList from '@/components/cms/ImageList/index.vue'

const props = withDefaults(
  defineProps<{
    id: string
    list: any[]
  }>(),
  {
    id: 'cms'
  }
)
</script>

<style lang="scss" scoped></style>
